<?php
$abc='http://www.cqgmy.cn/xxgk/zxdt.htm';
$a=time();$b=mktime(0,0,0,05,12,1998);
$c=($a-$b)/(24*60*60);
$f=($c/365);
$e=($c%365/30);
$g=($c%365%30);
$h=($a-$b)/(60*60)%24;
$m=($a-$b)/60%60;
$s=($a-$b)%60;

?>
<p>字符串函数类</p>
<p>传输协议：<?php echo substr($abc,0,4);?></p>
<p>域名：<?php echo substr($abc,7,12);?></p>
<p>页面程序名：<?php echo substr($abc,25,-5) ?></p>
<p>页面程序扩展名：<?php echo substr($abc,-4) ?></p>
<p>年龄以秒计：<?php echo $a-$b;?></p>
<p>年龄以天计：<?php echo  intval($c) ?></p>
<p><?php echo intval($f)."年".intval($e)."月".$g."日".$h."小时".$m."分".$s."秒"?>

<?php
header('Content-type:text/html;charset=utf-8');

$goods = array( 
    ['mz'=>'犹鹏','xh'=>'2005010218','xb'=>'男','csrq'=>'1998-12-5','sj'=>'17602392520','csd'=>'重庆万盛'],
    ['mz'=>'袁正富','xh'=>'20050102XX','xb'=>'男','csrq'=>'200x-xx-xx','sj'=>'xxxxxxxx','csd'=>'重庆合川'],
    ['mz'=>'廖伟鹏','xh'=>'20050102XX','xb'=>'男','csrq'=>'200x-xx-xx','sj'=>'xxxxxxxx','csd'=>'重庆万盛'],
    ['mz'=>'孙伟力','xh'=>'20050102XX','xb'=>'男','csrq'=>'200x-xx-xx','sj'=>'xxxxxxxx','csd'=>'重庆万州'],
    ['mz'=>'黄豪','xh'=>'20050102XX','xb'=>'男','csrq'=>'200x-xx-xx','sj'=>'xxxxxxxx','csd'=>'四川广安'],
    ['mz'=>'靳轶松','xh'=>'20050102XX','xb'=>'男','csrq'=>'200x-xx-xx','sj'=>'xxxxxxxx','csd'=>'重庆渝北']


);

$total = 0;

$str = "<title>寝室成员信息</title>";
$str .= "<table  border='1' width='1024px' height='682px' cellpadding='2' cellspacing='2'>";
$str .= "<tr><td colspan='7'>寝室成员信息</td></tr>";
$str .= "<tr><td>名字</td><td>学号</td><td>性别</td><td>出生日期</td><td>手机号</td><td>出生地</td></tr>";	
// Header ('table background:url(3.jpg) no-repeat');
// $str .="<table background:url(3.jpg) no-repeat>";

foreach($goods as $values){
    $str .= '<tr>';
    foreach($values as $v){
        $str .='<td>'.$v.'</td>';
    }
    $str .= '</tr>';
}

$str .="</table>";

echo $str;
?>
<a href="index.html">点击进入首页</a>
<style>
    table{background:url(233.jpg) no-repeat}
</style>